package cn.kgc.springmvc.exception;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author: mosin
 * @version: v1.0  2022/10/20
 */
@RequestMapping("teacher")
@Controller
public class TeacherController {


    @RequestMapping("e1")
    public String  ex1(){
        System.out.println("teacherController中的ex1方法被调用");
        // 模拟异常
        String str = null;
        str.length();
        return "hello";
    }


    @RequestMapping("e2")
    public String  ex2(){
        System.out.println("teacherController中的ex1方法被调用");
        // 模拟异常
        int a = 1/0;
        return "hello";
    }
}
